<?php
return [
    'server' => [
        'swConfig' => [
            'pid_file'              => runtime_path() . 'rpc-server.pid',
            'log_file'              => runtime_path() . 'rpc-server.log',
            'daemonize'             => false,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024,
        ],
        'host' => [
            'host' => '127.0.0.1',
            'port' => 8099,
            'socket' => SWOOLE_TCP
        ],
        // client list cache
        'clientList' => [
            'type' => 'file',
            'cacheName' => 'rpcClientListCache',
            'path' => runtime_path() . 'store' . DIRECTORY_SEPARATOR . 'rpcClientList' . DIRECTORY_SEPARATOR,
            // second
            'expired' => 0
        ],
        'websocket' => [
            'enable' => true,
            'ping_interval' => 25000,
            'ping_timeout'  => 60000,
        ],
        'event' => \iflow\Swoole\Services\WebSocket\socketio\Event::class,
        'Handle' => \iflow\Swoole\Rpc\lib\rpcReceive::class,
        // client connection event
        'connection' => \iflow\Swoole\Rpc\lib\rpcConnection::class,
        'keep_alive' => 10
    ],
    'client' => [
        'swConfig' => [
            'pid_file'              => runtime_path() . 'rpc-client.pid',
            'log_file'              => runtime_path() . 'rpc-client.log',
            'daemonize'             => false,
            'reactor_num'           => swoole_cpu_num(),
            'worker_num'            => swoole_cpu_num(),
            'task_worker_num'       => swoole_cpu_num(),
            'package_max_length'    => 20 * 1024 * 1024,
            'buffer_output_size'    => 10 * 1024 * 1024,
            'socket_buffer_size'    => 128 * 1024 * 1024
        ],

        // client connection info
        'host' => [
            'host' => '127.0.0.1',
            'port' => 8098,
            'socket' => SWOOLE_TCP
        ],

        // bind server info
        'server' => [
            'host' => '127.0.0.1',
            'port' => 8099
        ],

        'websocket' => [
            'enable' => true,
            'ping_interval' => 25000,
            'ping_timeout'  => 60000,
        ],

        // rpc client name
        'clientName' => 'RPC-TEST',

        // client request react before event
        'event' => \iflow\Swoole\Services\WebSocket\socketio\Event::class,
        'Handle' => \iflow\Swoole\Rpc\lib\rpcClient::class,
        'keep_alive' => 1000,
        're_connection' => 1000,
    ]
];